<!DOCTYPE html>
<!-- 
	HTML5入门（ajax网络数据请求）
	https://blog.csdn.net/cmwly/article/details/82383589
	
	参考文章地址：http://www.w3school.com.cn/jquery/ajax_ajax.asp
	
	jquery官网地址：https://jquery.com/download/
 -->
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="https://code.jquery.com/jquery-3.7.0.js"></script>
		<!-- <script src="netrequest/jquery-3.7.0.js"></script> -->
		<script>
			function testNetRequest(){
				$.ajax({
					type:"get",
					// url:"https://www.baidu.com",
					url:"https://10.168.26.226:8006/userList",
					contentType: 'application/json;charset=UTF-8',
					success:function(data) {
						alert(data)
						console.log("success 成功数据："+data)
					},
					error:function(data){
						alert(data)
						console.log(" error 异常数据："+data)
					}
				});
			}
		</script>
	</head>
	<body style="background-color: aqua;">
		<div id="getBaiduData" onclick="testNetRequest()" style="position: absolute; margin-left: 100px; margin-top: 200px;">请求数据</div>
	</body>
</html>